package service

import (
	"api/internal/svc"
	"context"
	"strconv"
)

type AuditService struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
}

const (
	CA_COUNT = "caCount" // HASH 当前用户待认证数  1.双重认证(身份证、学位证)通过； 2.头像认证通过   3.昵称通过  4.封面  共6个
)

func NewAuditService(ctx context.Context, svcCtx *svc.ServiceContext) *NotifyService {
	return &NotifyService{
		ctx:    ctx,
		svcCtx: svcCtx,
	}
}

func (auditService *AuditService) setCaCount(userId int) {
	count := 6 //审核数量6
	field := "user:" + strconv.Itoa(userId)
	redis := auditService.svcCtx.RedisPool.Get()
	defer redis.Close()

	redis.Do("HSET", CA_COUNT, field, count)
}
